<!-- 我的弹窗 -->

<template>
  <WebModal>
    <WebForm>
      <FormInput :label="`${CORE.MAP.CONTRACT}名称`" bind="projectName" :max="30" required />

      <EasyRow col2>
        <FormInput :label="`${CORE.MAP.CONTRACT}编号`" bind="projectCode" :max="30" required />
        <FormSelect
          :label="`${CORE.MAP.CONTRACT}类型`"
          bind="projectTypeId, projectTypeName, projectTypeCode"
          :dict="DICT.TYPE"
          required
        />
      </EasyRow>

      <EasyRow col2>
        <FormInput :label="`${CORE.MAP.CONTRACT}金额`" bind="budget" suffix="元" />
        <FormSelect
          :label="`${CORE.MAP.CONTRACT_LEVEL}等级`"
          bind="contractLevel"
          :dict="CORE.DICT.contract_level"
          required
        />
      </EasyRow>

      <EasyRow col2>
        <FormTree
          :label="`所属${CORE.MAP.ORGAN}`"
          bind="organizationId, organizationName"
          :dict="CORE.ORGAN.DICT"
          required
        />
        <FormInput label="负责人" bind="principalUserName" :max="10" required />
      </EasyRow>

      <!-- 采购合同 -->
      <EasyRow v-if="one.projectTypeId === '1'" col2>
        <FormDate label="签订日期" bind="signingTime" />
        <FormDate label="验收日期" bind="checkedTime" lastSecond />
        <FormDate label="维保期限" bind="maintenanceEndTime" lastSecond />
      </EasyRow>

      <!-- 服务合同 -->
      <EasyRow v-if="one.projectTypeId === '2'" col2>
        <FormDate :label="`${CORE.MAP.CONTRACT}期限`" bind="contractEndTime" lastSecond />
      </EasyRow>

      <EasyRow col2>
        <FormSelect label="到期提醒" bind="expiredRemind" :dict="DICT.REMIND" noClear />

        <FormSlot v-if="one.expiredRemind" label="提醒人" bind="remindId" tip="请选择提醒人" required>
          <ModalUser />
        </FormSlot>
      </EasyRow>

      <ShowFile v-if="isShow" :label="`${CORE.MAP.CONTRACT}附件`" bind="projectFileDto" />
      <FormFile
        v-else
        :label="`${CORE.MAP.CONTRACT}附件`"
        bind="projectFileDto"
        folder="contract"
        :newObj="{ projectId: one.id }"
      />
    </WebForm>
  </WebModal>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyModal',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),
}
</script>
